package application.translators.impl;

import application.model.StandardModel;
import application.model.StandardsModel;
import application.translators.Translator;
import mappings.Standards;

import java.util.List;

public class StandardsTranslator implements Translator<List<Standards>, StandardsModel>
{
    @Override
    public StandardsModel translate(List<Standards> input)
    {
        StandardsModel standardsModel = new StandardsModel();

        for(Standards standard : input)
        {
            StandardModel standardModel = new StandardModel();

            standardModel.setId(standard.getId());
            standardModel.setName(standard.getName());

            standardsModel.addStandard(standardModel);
        }

        return standardsModel;
    }
}
